Integrated circuit, having microprocessor and telephony peripheral circuitry, having capability of being placed in partial emulation mode

ABSTRACT

An in-circuit emulation capability mode incorporated in an integrated circuit. The in-circuit emulation capability mode disables the microcontroller of the integrated circuit and allows use of an external in-circuit emulator device to test and debug the integrated circuit without the necessity of physically replacing the microcontroller with in-circuit emulator hardware. The in-circuit emulation capability mode is suitable for any integrated circuit, however, it has been found that integrated circuits incorporating an in-circuit emulation capability mode are especially suitable for incorporation into the base and handset units of a cordless telephone that integrates the speech, control channels, and microcontroller portions of a modem, and the man-machine interface functions of a cordless telephone.

This application is a continuation of application Ser. No. 08/387,389 filed on Feb. 13, 1995 now abandoned, which was a continuation of application Ser. No. 07/918,632 filed on Jul. 21, 1992, which are now abandoned.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is related to the following U.S. patent applications:

U.S. application Ser. No. 07/917,497, filed Jul. 21, 1992, entitled: "General I/O Port Interrupt Mechanism," Gulick, et al., issued as U.S. Pat. No. 5,448,743 on Sep. 5, 1995;

U.S. application Ser. No. 07/917,489, filed Jul. 21, 1992, entitled: "Improved External Memory Access Control for a Processing Unit," Gulick, et al., issued as U.S. Pat. No. 5,408,639 on Apr. 18, 1995;

U.S. application Ser. No. 08/332,430, filed Oct. 31, 1994, entitled: "Method of Weak Pull-up Disable and Mechanism Therefor for Use with Microcontroller in Integrated Circuit and Cordless Telephone Using the Integrated Circuit," Bowles, et al., now pending, which is a continuation of U.S. application Ser. No. 07/917,488, filed Jul. 21, 1992, now abandoned;

U.S. application Ser. No. 08/346,834, filed Nov. 30, 1994, entitled: "Apparatus and Method for Disabling Interrupt Masks in Processors or the Like," Bowles, et al., issued as U.S. Pat. No. 5,530,597 on Jun. 25, 1996, which is a continuation of U.S. application Ser. No. 07/917,503, filed Jul. 21, 1992, entitled: "Interrupt Mask Disable Circuit and Method," now abandoned;

U.S. application Ser. No. 07/918,627, filed Jul. 21, 1992, entitled: "Integrated Circuit and Cordless Telephone Using the Integrated Circuit," Gulick, et al., issued as U.S. Pat. No. 5,555,287 on Sep. 10, 1996;

U.S. application Ser. No. 08/463,683, filed Jun. 5, 1995, entitled: "Self-Contained Self-Tested Modulator (as amended)," Peterson et al., now pending, which is a continuation of U.S. application Ser. No. 07/918,626, filed Jul. 21, 1992, entitled: "Self-Contained Self-Tested Modulator (as amended)," now pending;

U.S. application Ser. No. 08/464,072, filed Jun. 5, 1995, entitled: "Keypad Scanner Process and Device and Cordless Telephone Employing the Mechanism," Gulick, issued as U.S. Pat. No. 5,512,893, on Apr. 30, 1996, which is a continuation of U.S. application Ser. No. 07/918,625, filed Jul. 21, 1992, now abandoned;

U.S.application Ser. No. 07/918,624, filed Jul. 21, 1992, entitled: "application Ser. Interface Module and Method in Which the Clock is Only Activated to Send a Predetermined Number of Data Bits," Gulick, et al., issued as U.S. Pat. No. 5,404,459 on Apr. 4, 1995;

U.S. application Ser. No. 08/320,778, filed Oct. 11, 1994, entitled: "Low Power Emergency Telephone Mode," Peterson, et al., issued as U.S. Pat. No. 5,495,530, on Feb. 27, 1996, which is a continuation of U.S. application Ser. No. 07/918,631, filed Jul. 21, 1992, now abandoned;

U.S. application Ser. No. 08/201,077, filed Jun. 5, 1995, entitled: "Clock Generator Capable of Shut-down Mode and Clock Generation Method," Peterson, et al., issued as U.S. Pat. No. 5,502,689, on Mar. 26, 1996, which is a continuation of U.S. application Ser. No. 07/918,622, filed Jul. 21, 1992, now abandoned; and

U.S. application Ser. No. 07/918,621, filed Jul. 21, 1992, "Signal Averger," Gulick, issued as U.S. Pat. No. 5,420,904 on May 30, 1994.

All of the related applications are filed on even date herewith, are assigned to the assignee of the present invention, and are hereby incorporated herein in their entirety by this reference thereto.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an in-circuit emulator capability mode in an integrated circuit and, more particularly, to such an in-circuit emulator capability mode incorporated in an integrated circuit involved with the speech, control channel, or microcontroller portions of a modem, or with the man-machine interface functions of a cordless telephone.

2. Description of Related Art

An in-circuit emulator (ICE) is a device which allows a prototype, for example, a prototype integrated circuit including a microcontroller, to be attached to a development system for purposes of testing and debugging the prototype. A development system is a tool for development of software for use with the prototype which transforms the software to a form useable by the prototype and allows for download of the software to the prototype's memory for execution. With the help of an ICE, the memory and Input/Output of a development system can be shared with the prototype. This allows for real time operation of the prototype during initial stages of development of the prototype prior to integrating the prototype with other units of an electrical system. By so using an ICE, hardware and software designs may be tested in a prototype which forms only a part of (and likely performs only a limited function in) an integrated electronic system composed of a number of units performing a variety of functions which acting together perform as the system. Further, once the prototype is integrated with the entire integrated system, an ICE may be used to extensively test the integrated system in an emulation mode by thereby performing iterations involving various aspects of the software and hardware of the system.

Typically, ICE's are separate devices from the prototype or electronic system tested therewith. As is known to those skilled in the art, to connect and use an ICE with a particular IC prototype or electronic system to be tested, the microcontroller of the IC must be physically replaced with the ICE hardware. Only by such physical replacement may the ICE be used to emulate the microcontroller and allow software developers to develop and debug their software. Replacement of the microcontroller of an IC with ICE hardware is easily effected if the microcontroller is kept separate from the rest of the electronic system, that is, when it is not incorporated into an IC and is removable from the rest of the system. Replacement of the microcontroller with ICE hardware is not easily effected if the microcontroller is fixedly incorporated into the IC to be tested. It is generally preferred that microcontrollers be incorporated and fixed with an IC, rather than as a separate unit connected therewith. Incorporation of microcontrollers into the IC is typically more economical from a manufacturing perspective and limits the space needed to house the electronics of a device.

To date, only a single solution to these problems inherent in the procedure of replacing a microcontroller with an ICE in a particular system has been known. That solution involves building a mini ICE hardware piece and incorporating the piece into the design of the IC. The hardware piece is then used to emulate the microcontroller and provide the IC with all of the general purpose functions of the microcontroller. The problem with this approach is that these additional hardware pieces increase the expense of the system and the space needed to house the system.

The present invention, an in-circuit emulation capability mode incorporated in an IC allows use of an external ICE to test and debug IC software and hardware without the necessity of physically replacing the microcontroller of the IC with the ICE hardware. As is apparent, the invention presents a better solution to the problems with the physical replacement of a microcontroller with ICE hardware.

One particular application for which an IC incorporated with an in-circuit emulation capability mode is well-suited is a cordless telephone. Cordless telephones may be contrasted with standard telephones in several respects. The standard telephone consists of a base unit and a handset unit connected to each other by an electrical cord. The base unit itself is connected by another cord to a receptacle on a wall, telephone pole or a similar immovable structure to which the telephone network line extends. Because of this connection to an immovable structure, the range of movement of the operator of the telephone is quite limited. Even when the cords connecting the handset unit to the base unit and the base unit to the wall are long, it can be cumbersome either to move the entire telephone around to make calls from different locations or to walk around with the handset unit once a call has been placed. The simple fact that there is always a continuous physical connection between the person making the phone call and the immovable wall or other fixed structure can be a great inconvenience.

The cordless telephone, on the other hand, represents a significant improvement over the standard telephone. In the conventional cordless telephone, the base unit is still connected to the receptacle on the immovable wall or the like by a cord so that message signals from the telephone network line may be received and transmitted. However, the handset unit of the cordless telephone is an independently operative unit from which calls may be made and by which calls may be received with no physical connection to the base unit. The handset unit has a transmitting/receiving system or transceiver, a loudspeaker in an earpiece and a microphone in a mouthpiece. The base unit and the handset unit of the cordless telephone communicate with each other over a communication channel established by the transmission and reception of electromagnetic waves, conventionally radio waves. The handset unit may then be taken considerable distances from the base unit while still making and receiving telephone calls. Since there is no telephone cord extending between the handset unit and the base unit, the operator is free to move about without hindrance.

Heretofore, integrated circuits have been developed and used in cordless telephones to perform various functions. There are, however, a number of aspects of IC's in such phones that can be improved. One such aspect includes incorporating an in-circuit emulation capability mode in the design of the IC. Such an aspect alleviates the previously described problems encountered in testing and debugging associated with either replacing the IC's microcontroller with an external ICE or building a mini in-circuit emulator hardware piece that emulates the microcontroller.

Based upon the foregoing, those skilled in the art should now perceive that an in-circuit emulation capability mode incorporated in the design of an IC, for example, an IC for use in cordless telephones, is an improvement over the existing technology. It is a shortcoming and deficiency of the prior art that such an improvement has not previously been conceived.

SUMMARY OF THE INVENTION

To overcome the aforementioned shortcomings and deficiencies, the present invention generally provides an in-circuit emulation capability mode incorporated in the circuitry of an IC. More particularly, the present invention provides such an in-circuit emulation capability mode incorporated in a single IC, which IC is designed to be installed in both the base unit and handset unit of a cordless telephone and integrates the speech, control channels, and microcontroller portions of a modem, and the man-machine interface functions of a cordless telephone.

In one aspect of the invention, the present invention is an integrated circuit with a microcontroller and includes a means for disabling the microcontroller and a means for enabling an external emulator to function for the microcontroller when the microcontroller is disabled. In another aspect of the invention, the above-described integrated circuit includes a reset pin and a tri-level input 1 pin, the means for disabling and the means for enabling each being activated at reset if, when the rest pin goes high, the tri-level input 1 pin is low.

In yet another aspect of the invention, the above-described microcontroller has a clock input thereto, said clock input being routed away from said microcontroller when the means for disabling and the means for enabling are activated.

In a further aspect of the invention, the above-described integrated circuit includes a watchdog timer which does not operate when the means for disabling and the means for enabling are activated.

In another aspect of the invention, the above-described integrated circuit includes address and data bus control signals, at least one of the address and data bus control signals becoming an input when the means for disabling and the means for enabling are activated.

In yet another aspect, of the invention, the above-described integrated circuit includes at least one internally connected I/O port, the means for disabling and the means for enabling causing the at least one internally connected I/O port to be electrically routed away from the microcontroller.

In yet a further aspect of the invention, the above-described integrated circuit includes a clock, electrically connected to a timer 0 input and a timer 1 input, the clock remaining electrically routed to the microcontroller when the means for disabling and the means for enabling are activated.

The present invention also includes the improvement in an integrated circuit containing a microcontroller wherein the integrated circuit includes an in-circuit emulation capability mode.

In another aspect of the invention, the above-described integrated circuit is for use in a base unit and a handset unit of a cordless telephone.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of the present invention, and for further objects and advantages thereof, reference may now be had to the following detailed description taken in conjunction with the accompanying drawings wherein:

FIG. 1 (which consists of FIG. 1a and FIG. 1b) is a block diagram of an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention;

FIG. 2 is a block diagram of a handset unit of a cordless telephone into which an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention has been installed; and

FIG. 3 is a block diagram of a base unit of a cordless telephone into which an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention has been installed.

FIG. 4 is a block diagram of a microcontroller system that may form part of an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention;

FIG. 5 is a block diagram of a clock generator module that may form part of an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention;

FIG. 6 is a possible structure for an interrupt controller that may form part of an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention;

FIG. 7 shows a possible structure of the status, mask, and source registers necessary to handle interrupt cause signals from a logic module in an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention;

FIG. 8 shows a state diagram of a watchdog timer and a reset output mechanism that may form part of an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention;

FIG. 9 shows a possible organization of a watchdog timer that may form part of an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention;

FIG. 10 shows a possible basic structure of an interrupt function mechanism that may form part of an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention;

FIG. 11 shows an external interrupt input structure that may be present in an exemplary IC including the in-circuit emulation capability mode of the present invention;

FIG. 12 shows a block diagram of a serial interface that may be present in an exemplary IC including the in-circuit emulation capability mode of the present invention;

FIG. 13 is a block diagram of a keypad scanner that may form part of an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention;

FIG. 14 is a block diagram of a real-time clock module that may form part of an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention;

FIG. 15 is a block diagram of a battery level detector that may form part of an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention;

FIG. 16 shows various CT2 modules that may form part of an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention;

FIG. 17 is a block diagram of a transmit modulator that may form part of an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention and;

FIG. 18 is a block diagram of a frame controller that may form part of an exemplary IC which includes an in-circuit emulation capability mode according to the teachings of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

In the detailed description that follows, to facilitate understanding of the present invention, and as an example only, an embodiment of the in-circuit emulation capability mode of the present invention which is incorporated into an exemplary IC for use with a cordless telephone system is precisely described. It should be expressly understood that the present invention is not necessarily limited to that application, although the invention has been found to work especially well in actual practice when so used. Further, it should also be expressly understood that a multitude of different embodiments of the present invention could be employed in the particular application described; as is typical and understood, the present invention is limited solely by the scope of the appended claims.

GENERAL DESCRIPTION OF IN-CIRCUIT EMULATION CAPABILITY MODE

The in-circuit emulation capability mode of the present invention is incorporated in the circuitry of an IC. The mode serves to disable the microcontroller of the IC and allow an external ICE to function in the place of the microcontroller. Incorporating the mode into the IC circuitry in accordance with the teachings of the present invention eliminates the problems in the prior art of physically replacing the microcontroller with the ICE device in order to perform ICE software development and software and hardware debugging.

The in-circuit emulation capability mode is incorporated with the IC in a manner such that the mode is triggered by particular signals in the IC circuitry. An IC circuit incorporating an in-circuit emulation capability mode should, therefore, have at least two operational modes: a normal operating mode and the in-circuit emulation mode. In the normal operating mode, the microcontroller functions to control the electron paths through the circuitry of the IC. However, when particular signals in the IC circuitry trigger the in-circuit emulation capability mode, control functions are diverted from the microcontroller to an external ICE which then, in lieu of the microcontroller, serves to control the IC circuitry.

Thus, it should be understood that an IC may support an in-circuit emulation capability mode that disables an on-chip microcontroller allowing an external ICE to function in its place. In a preferred embodiment of the in-circuit emulation capability mode, the mode is triggered in an IC at reset if, when the reset pin goes high, the tri-level input 1 pin is low. Further in such an embodiment, all internal connections to Input/Output ports are routed from the microcontroller (i.e., "off chip"), with the exception of the clock connected to the timer 0 and timer 1 inputs (this clock can be external to the IC). ALE and PSEN/ then become inputs. The clock input to the microcontroller, which is routed off chip, is forced on at reset in in-circuit emulation capability mode. The watchdog timer of the IC, in such an embodiment, does not operate in this mode.

THE IC ITSELF

Referring now to the drawings wherein for convenience and clarity like or similar elements are generally referred to with the same reference numeral throughout the several views and initially to FIG. 1, there is shown a block diagram of an exemplary IC which incorporates an in-circuit emulation capability mode according to the teachings of the present invention. Pertinent elements of the exemplary IC with respect to the in-circuit emulation capability mode thereof will be discussed hereinbelow. The exemplary IC includes an 8-bit microcontroller providing the function of the 80C32T2 member of the 80C51 family of Advanced Micro Devices (AMD) products, which microcontroller will also be discussed herein to the extent as may be relevant to the particular embodiment of the in-circuit emulation capability mode incorporated in the exemplary IC.

OPERATING MODES

Generally describing the IC shown in FIG. 1, it may be noted initially that the IC has three basic modes of operation. Those three modes are an in-circuit emulation mode, a normal mode, and a test mode. The in-circuit emulation capability mode is the subject of the present invention. Generally, the in-circuit emulation capability mode disables the on-chip microcontroller (designated by reference numeral 40 in FIG. 1), allowing an external ICE to be used for software development and software and hardware debugging. The normal mode is the mode in which the product containing the IC is operated by the end user. A final mode of operation, the test mode, is basically the same as the normal mode, except that in the test mode it is possible to also enable internal test functions of the IC.

Entry into the three operating modes is controlled by the state of the reset pin 42 and the tri-level IN1 (TRI1) pin 44. Although those pins 42, 44 could effect such selection in a number of different ways, one way would be to have the state of the TRI1 pin be monitored and acted upon by the IC when the reset pin 42 goes inactive. If the TRI1 is low, for example, the in-circuit emulation capability mode could be activated. At a mid supply or no-connect point, the test mode could be activated. Finally, when the TRI1 pin is high and, again, when the reset pin 42 goes inactive, the IC could operate in the normal mode.

In this exemplary IC, the in-circuit emulation capability mode is triggered at reset if, when the reset pin 42 goes high, the tri-level input 1 pin 44 is low. Further, all internal connections to I/O ports of the exemplary IC are routed from the microcontroller (i.e., "off-chip"), with the exception of the clock connected to the timer 0 and timer 1 inputs (this clock can be external to the IC). ALE and PSEN/ then become inputs. The clock input to the microcontroller, which is routed off chip, is forced on at reset in in-circuit emulation capability mode. The watchdog timer 46 does not operate in this mode.

When the IC shown in FIG. 1 (which IC, it should be noted, depicts an exemplary embodiment of the present invention) is placed in the in-circuit emulation capability mode, a number of pins shown in FIG. 1 change function. Specifically, in the in-circuit emulation capability mode, the following pins change function as described below:

    ______________________________________                                         PIN          USE IN ICE MODE                                                   ______________________________________                                         INT0/OUT,    INT0/OUT                                                          CSOUT0/                                                                        INT1/OUT,    INT1/OUT                                                          CSOUT1/                                                                        CPUCLKOUT,   CPUCLKOUT                                                         CSOUT2/                                                                        ALE I/0, OUT9                                                                               ALE INPUT                                                         RD/          RD/ INPUT                                                         WR/          WR/ INPUT                                                         ADDR15-8     ADDR15-8 INPUTS                                                   ADDR/DATA7-0 ADDR/DATA7-0 - ADDRESSES = INPUTS                                              DATA I/O = O/I                                                    P1.6-0       HIGH-Z                                                            P1.7         INPUT                                                             P3.1-0       HIGH-Z                                                            ______________________________________                                    

REGISTERS

Because of the level of sophistication of those skilled in the art and the degree of detail shown in FIGS. 1-3, no attempt will be made herein to precisely describe the functions of each pin and register within the exemplary IC shown. Such a description is simply not necessary for those skilled in the relevant art to obtain a full understanding of all of the inventive aspects of the present invention. Further, reference may be had to the various related applications for further specifics about these and other aspects.

SYSTEM CONTROL--REQUIREMENTS

Certain aspects of the IC system control relevant to the in-circuit emulation capability mode are, however, described hereinbelow. For further details than those given herein of system control requirements and other system matters of the IC, reference may be had to the various related applications.

In the exemplary IC shown in FIG. 1 (which IC, as previously stated, is exemplary of the type IC in which the present in-circuit emulation capability mode may be incorporated), the PSEN/pin assumes a high impedance state when the in-circuit emulation capability mode of the IC is triggered.

As part of a functional view of the system control, it is appropriate now to discuss I/O port utilization and effects thereon of the in-circuit emulation capability mode. Accordingly, each of the four I/O ports used in the exemplary IC in which the present invention may be included is discussed immediately below.

With regard to Port O, it is used in connection with multiplexed address/data bus bits 7-0.

Port 1 is used for general I/O lines. These lines are mapped to specific control functions by software. The Port 1 I/O lines contain a weak pull-up. During emulation mode, the weak pull-ups are disabled and the port pins assume a high impedance state.

Port 2 is used for address lines 15-18. The Port 2 I/O lines contain a weak pull-up. Disabling the weak pull-up is accomplished by setting a corresponding port control register bit (PCRB) to an appropriate value. After RESET, the Port 2 weak pull-ups are enabled. During emulation mode, the weak pull-ups are disabled and the port pins assume a high impedance state.

With regard now to Port 3, P3.0, P3.1, P3.2, P3.3, P3.4, P3.5, P3.6, and P3.7 need to be discussed.

P3.0 is used as either the microcontroller serial port receive data input (RxD) or as a general purpose I/O pin. P3.1 is used as either the microcontroller serial port transmit data output (TxD) or as a general purpose I/O pin. P3.2 is used internally as an interrupt input from the internal interrupt controller (INT0/). P3.3 is used internally as an interrupt input from the internal interrupt controller (INT1/). P3.4 is used as the internal timer 0 clock input. This pin is not available external to the IC. P3.5 is used as the internal timer 1 clock input. This pin is not available external to the IC. P3. 6 is the WR/ strobe for the address/data bus. P3. 7 is the RD/ strobe for the address/data bus. The Port 3 I/O lines contain a weak pull-up. Disabling the weak pull-up is accomplished by setting a corresponding port control register bit (PCRB) to an appropriate value. After RESET, the Port 3 weak pull-ups are enabled. During emulation mode, the weak pull-ups are disabled and the port pins assume a high impedance state.

Discussing now I/O buffer configuration, in the exemplary IC in which an embodiment of the present invention may be incorporated, the Port 1, 2, and 3 I/O buffers are capable of disabling the weak p-channel pull-up through software control. The necessity of this function permits the buffers to eliminate current sourcing when the buffer is driven low by an external signal. This weak pull-up disabling feature of the exemplary IC eliminates undesirable power consumption increases. The AMD 80C32T2 lacks such a mechanism. After reset, all of the Port 1, 2, and 3 I/O buffers are held "high" by the weak pull-up. This state is functionally compatible with the 80C32T2 microcontroller. To disable the weak pull-up, the software must first disable each bit by configuring the port pin with the corresponding port control register bit. The corresponding port control register bit resides at the same address as the port SFR bit. For example, Port 1 resides at SFR memory location 90H. The Port 1 control register also resides at SFR memory location 90H. Modification of the Port 1 Control Register is only accomplished when the PCRA bit in the PCFIG SFR is set to a "1". When the PCRA bit is cleared, an operation to the Port SFR address results in the Port SFR getting updated.

Since only Ports 1, 2 and 3 contain weak pull-ups, Port 0 is exempt from this feature.

The following table describes the different combinations of the port setup in the exemplary IC.

    ______________________________________                                         PCRB    PORT         BIT FUNCTION                                              ______________________________________                                         0       0            Drives a "0" output, no pull-up                                                (80C51 compatible)                                        0       1            Drives a "1" for 2 cycle, weak                                                 pull-up is on. (80C51                                                          compatible)                                               1       0            Drives a "0" output, no pull-up                           1       1            Input only, (no pull-up, high                                                  impedance input)                                          ______________________________________                                    

Upon power-up, the PCRA bit is disabled and any writes to the ports result in the port SFR being updated. Once the PCRA bit in the PCFIG register is set, it becomes possible for each port bit to have the weak p-channel device turned off. After each port bit is appropriately configured, the user must clear the PCRA bit before writing to the ports.

If the user turns on the weak p-channel device after it is disabled, the port pin may not return to a "1" immediately. This condition is similar to the 80C51 when an external device drives the input signal low and then allows the pin to "float" back to a "1". This rise time of the signal is dependent on the loading of the pin and may take several microseconds to return to a stable "1".

Discussing now the interface to on-chip peripheral bus in the exemplary IC presented as an example of the type of IC in which the present invention may be incorporated, all user visible registers and on-chip RAM reside on an internal version of the microcontroller address/data bus. In order to reduce power consumption, this bus does not change state during accesses to program memory space. When the IC is in an in-circuit emulation mode, this power saving feature is not available, and the on-chip peripheral bus will transition during accesses to program memory space.

Discussing now on-chip RAM in the exemplary IC, such an IC having an 80C32T2 microcontroller has 256 bytes of RAM located in the "Internal Data RAM" space. 1024 bytes of additional "on-chip" RAM is located in "External Data RAM" space. All of the 1024 bytes of on-chip RAM is backed up by the real-time clock's back-up battery. The backed up RAM can support read and write accesses down to 2.2 Volts. The backed up RAM can retain data down to 1.8 Volts.

Discussing now interrupt enable during shut-down in the exemplary IC, if the IC is in a shut-down mode and the microcontroller is in an idle mode, the condition of the microcontroller's interrupt mask bits (TCON register bits 7, 2, and 0) is ignored, enabling the INT0/and INT1/interrupts. The actual TCON bits are not changed to safeguard against the IC entering a shut-down mode with interrupts disabled.

It should also be noted that in the exemplary IC, anytime that the CPUCLK speed is programmed to be less than 9.216 MHz the length of the PSEN pulse is shortened by one cycle of CPUCLK (that is, the falling edge is delayed by one CPUCLK cycle). This reduces the power consumed by the external memory devices when the CPUCLK is slowed down.

Those skilled in the art should take note with reference to FIG. 4 that the ALE I/O pin is multiplexed with the general output bit 9. The INT0/OUT and INT1/OUT pins are multiplexed with the external I/O 0 and external RAM chip select outputs, respectively, from the address decoder module 76. During the in-circuit emulation mode, these pins always provide the ALE-OUT, INT0/, and INT1/OUTPUT functions. During normal operation, the ALE pin can be either ALE OUT or general output 9. Selection is programmed in the address decoder module. The INT0/ and INT1/ pins are always used as chip select outputs in normal operation.

Those skilled in the art should take further note with reference to FIG. 4 that a demultiplexed form of the 80C32T2's address bus is constructed by latching the low-order address byte, providing the LATCHED ADDRESS 7-0 pins. The address is latched off of the A/D 7-0 bus on the falling edge of ALE. In the exemplary IC, internal timing accounts for the delays associated with bringing A/D 7-0 and ALE on chip when the exemplary IC is in in-circuit emulation mode.

To facilitate a complete understanding of the microcontroller shown in FIG. 4 and its role in the IC of the exemplary IC which includes the in-circuit emulation capability mode of the present invention, a brief discussion of each pin shown therein follows.

P07-P0.0 is the microcontroller I/O port 0. This port provides the multiplexed D7-0 and A7-0 bus. When the exemplary IC is in reset the pins are held weakly high. In shut-down, the pins will either be held strongly low or weakly high. In in-circuit emulation mode the pins are high impedance.

P1.7-P1.0 is the microcontroller I/O port 1. This port provides the eight general purpose I/O pins associated with the parallel port module. When the IC is in reset the pins are held weakly high. In shut-down, the pins hold their programmed state. In in-circuit emulation mode the pins are high impedance.

P2.7-P2.0 is the microcontroller I/O port 2. This port provides the high order eight bits of the address bus (A15-8). When the IC is in reset or shut-down, the pins are held weakly high. In in-circuit emulation mode the pins are high impedance.

P3.7 is the microcontroller I/O port 3.7. This pin provides the microcontroller RD/ (read, active low) strobe. In in-circuit emulation mode the pin is high impedance. In shut-down or during reset the pin is held weakly high.

P3.6 is the microcontroller I/O port 3.6. This pin provides the microcontroller WR/ (write, active low) strobe. In in-circuit emulation mode the pin is high impedance. In shut-down or during reset the pin is held weakly high.

P3.1 is the microcontroller I/O port 3.1. This pin provides the microcontroller's internal serial port transmit data output. The pin can also be used as a general purpose I/O port. In in-circuit emulation mode the pin is high impedance. In reset the pin is held weakly high. In shut-down the pin holds its programmed state.

P3.0 is the microcontroller I/O port 3.0. This pin provides the microcontroller's internal serial port receive data input. The pin can also be used as a general purpose I/O port. In in-circuit emulation mode the pin is high impedance. In reset the pin is held weakly high. In shut-down the pin holds its programmed state.

PSEN/ is the program store enable. When active, the address on ports 0 and 2 pertains to code space. PSEN/ is placed in a high impedance state in in-circuit emulation mode, and is an output in normal mode. In reset, PSEN/ is held weakly high. In shut-down the pin is held strongly high.

ALE is the address latch enable. This signal is used to latch the address off of the A/D 7-0 bus. ALE is high impedance during in-circuit emulation mode. ALE is an output, multiplexed with OUT9 during normal mode. In shut-down or reset the pin is held strongly high.

LATCHED ADDRESS 7-0 is the output of the address latch, providing the non-multiplexed LA7-0 bus. At reset, shut-down, and in in-circuit emulation mode these pins are driven strongly.

SYSTEM CONTROL--CLOCK GENERATOR

The clock generator 82 (see FIG. 1a) provides the crystal oscillator, power mode control, module enable control, and clock dividers for the exemplary IC.

When the IC is placed in shut-down mode the 18.432 MHz oscillator (e.g., oscillator 72 in FIG. 3) and all clocks derived from it are stopped. All modules are disabled except the real-time clock 74. All analog pins are placed in their off state, that is, the same state as when the IC is in reset.

The IC is placed into shut-down mode by setting a bit in a shut-down/microcontroller clock control register. After the bit is set the oscillator 72 continues to run for 3.56-7.12 milliseconds in order for software to place itself in its idle mode, then all clocks, including the CPUCLK are stopped. In the exemplary IC, the IC terminates the shut-down cycle if an interrupt is received after the enable bit is set, and before the CPU clock is stopped.

Continuing to discuss the exemplary IC, access to the shut-down/microcontroller clock control register is protected by an interlock mechanism to reduce the risk of accidental clock stoppage due to software problems. This mechanism requires the software to write to a special access control register, and then write the shut-down/microcontroller clock control register. This double-write procedure must be done twice before the clock speed control register is updated.

Wake-up comes from reset, an any-key-down indication from the keypad scanner 88, the real-time clock interrupt (if not masked within the real-time clock 74), or any non-masked interrupt. When the IC leaves shut-down mode the oscillator is re-started. A delay of approximately 3.56 milliseconds is required for the oscillator to stabilize. After this delay, the microcontroller 44 and watchdog timer 46 clocks are re-started. The microcontroller clock re-starts at the previously programmed rate.

When the IC is in shut-down, the keypad any-key-down and real-time clock interrupts are enabled, even if the associated interrupt enable bits are cleared, i.e., even if the interrupts are disabled. The actual interrupt enable bits are not changed. Also, it should be noted that the real-time clock interrupts can still be masked within the real-time clock module 74 in the exemplary IC.

The microcontroller clock in the exemplary IC has a programmable divider with an input of 18.432 MHz. The programmable rates are divided by 2, 4, 8, 16, 32, 64, 128, and 256. When the IC leaves the shut-down mode, the CPU clock returns to the speed programmed in the control register. The CPUCLK can be turned off by placing the IC in shut-down mode.

When the clock speed is changed, the transition to the new frequency is accomplished without producing clock pulses that violate the 80C32T2, or other such appropriate product, data sheet timing specifications.

The microcontroller clock also has a selectable automatic speed-up mode. If the automatic speed-up option is selected, all interrupts force the microcontroller clock divider to the divide by two state. After the clock is sped-up, it will remain at the divided by two frequency until the speed is reprogrammed to a lower value. No illegally short pulses are allowed at the frequency transition point.

Once the command is issued by the microcontroller to enter shut-down, the processor clock continues to run for between 3.56 and 7.12 milliseconds before being stopped.

The clocks to each module are provided by the clock generator module 82. Control bits are provided to allow software to turn on and off specific modules. When a module is turned off, its clock is stopped and held low.

The serial port 94 supports data rates of 288 kHz, 144 kHz, and 36 kHz. The clock provided to the serial port module is divided down to the desired data rate by the clock generator module 82. The clock speed is selected via the serial port timing control register. The serial port module and this clock are enabled via a module enable control register 0. When the module is disabled, the clock is stopped low.

FIG. 5 is a block diagram of the clock generator module of the exemplary IC. As may be seen in FIG. 5, the clock generator module directly or indirectly comprises the oscillator 70, shut-down mode control logic 170, microcontroller clock control logic 172, module enables 174, and a module clock divider 176. Each of these is described further in an individual paragraph immediately below.

The oscillator 70 is designed to run at 18.432 MHz, using a parallel resonant mode crystal. Start-up capacitors are required; however, the exemplary IC minimizes capacitance value to save power.

The shut-down mode/microcontroller clock control logic 170, 172 controls the entry into shut-down, microcontroller clock frequency, and automatic speed-up.

With respect to the module enables 174, register bits to turn on and off specific modules within the IC are located in the clock generator module 82. These bits also stop the clock outputs to their respective modules.

The module clock divider logic 176 is a divider chain that produces the clock frequencies required by each module.

The clock generator module 82 has three pins. Pin MCLK XTAL is the master clock crystal pin 1. This pin is for input and is on the input side of the oscillator 70. The oscillator 70 is designed to work with either a parallel resonant crystal or an external logic level input. The MCLK XTAL 2 pin is the master clock crystal pin 2. This pin is for output and is on the output side of the oscillator 70. If a crystal is used, this pin is connected to the crystal. If an external logic level signal is used, this pin is left unconnected. The CPUCLKOUT pin is connected to the same clock that feeds the microcontroller 40. It is an output that can be routed off chip. In in-circuit emulation mode, the CPUCLKOUT is always active. When the IC is not in in-circuit emulation mode, this clock is multiplexed with the CSOUT2/ signal from the parallel I/O port module. The multiplexer control is located in the address decoder module 76 (see FIG. 1b). In reset, this pin defaults to the CSOUT2/ function, and is held high. At shut-down, if the pin is programmed for CPUCLK operation it is held low.

The clock controller module 82 of the exemplary IC contains the following programmable registers: a shut-down/microcontroller clock control register; a shut-down/microcontroller clock access; a protection register; a module enable control register 1; a module enable control register 2; and a serial port timing control register.

SYSTEM CONTROL--ADDRESS DECODER

The addresses of all internal registers as well as the on-chip RAM and the three external chip selects of the exemplary IC are decoded by the address decoder module 76. Enable signals are generated when internal registers or internal RAM is accessed by the microcontroller. Chip selects outputs are generated when external RAM space or either of the two external I/O spaces are accessed.

The address decoder module 76 of the exemplary IC includes a CSOUT0/pin, a CSOUT1/pin and a CSOUT2/pin. The CSOUT0/pin carries a signal which is multiplexed with the INT0/OUT signal. This pin also provides the chip select function when the IC is not in in-circuit emulation mode. The CSOUT0/signal is active (low) when a MOVX instruction is executed to the external I/O 1 space. In reset or shut-down this pin is held high. The CSOUT1/pin carries a signal which is multiplexed with the INT1/OUT signal. This pin also provides the chip select function when the IC is not in in-circuit emulation mode. The CSOUT1/ signal is active (low) when a MOVX instruction is executed to the external RAM space. In reset or shut-down this pin is held high. The CSOUT2/pin carries a signal which is multiplexed with the CPUCLKOUT signal. This pin also provides the chip select function when the IC is not in in-circuit emulation mode and the CSOUT2/enable bit is set in a chip select control register. The CSOUT2/signal is active (low) when a MOVX instruction is executed to the external I/O 2 space. In reset, this pin is held high. If the pin is programmed for CSOUT2/mode, it is held high in shut-down.

The aforementioned chip select control register is the only user visible register in the address decoder module 76.

It may also be noted that the decoder module 76 of the exemplary IC includes an address latch and an associated pin. The address latch provides the latched form of the low order eight address bits (LADDR 7-0). The latched address bus (LADDR 7-0) pins are outputs when the IC is in normal, shut-down, or in-circuit emulation modes. When the IC is in shut-down, the pins are driven strongly with the last value before entering shut-down. The outputs change on the falling edge of ALE.

SYSTEM CONTROL--INTERRUPT CONTROLLER

The interrupt controller 86 of the exemplary IC gathers interrupt requests from various sources internal and external to the IC and generates an interrupt to the microcontroller 40 (INT0/ and INT1/).

The interrupt system employed in the exemplary IC in which an embodiment of the in-circuit emulation capability mode of the present invention may be incorporated has a multilevel structure, including interrupt causes and status registers, a local mask, a local interrupt source register, a main interrupt mask register, and a main interrupt source register. Each of these elements is discussed further in an individual paragraph immediately below.

With regard to interrupt causes and status registers, the causes of the interrupts form the lowest level, and are local to each module. These causes can be inputs to pins, conditions such as empty or full data buffers, and the like. The causes are reported in "status registers". A status register, when read by software, always returns the current state of cause signal (for example, the current logic level on an input pin). The bits in a status register are not affected by interrupt masking.

Discussing now the local mask, the cause signals are ANDed with associated mask signals from an "interrupt mask register". The output of these AND gates connect to a "local interrupt source register". The mask register is located in the module that contains the associated cause signals.

The local interrupt source register is used by software to determine the cause of an interrupt. The bits in the interrupt source register can be set by either rising edge, falling edge, or both edges of the non-masked cause signal. The bits in interrupt source registers are cleared separately from each other. In general, each bit is cleared when software responds to the cause. This response can be reading a receive buffer, reading an input port status register, or the like. The outputs of each of the register bits is ORed together to produce one interrupt request signal. This signal is sent to the interrupt controller module. The source register is located in the module that contains the associated cause signals.

With respect to the main interrupt mask register, the interrupt request signals are ANDed with associated mask signals from the "main interrupt mask register" (located in the interrupt controller module 86). The output of these AND gates connect to a "main local interrupt source register".

The main interrupt source register is used by software to determine the cause of an interrupt. The bits in the interrupt source register reflect the logic level of the interrupt request signals, provided they are not masked. In general, each interrupt request is cleared when software responds to the specific interrupt cause. The outputs of the main interrupt source register are ORed together and forwarded to the microcontroller.

FIG. 6 shows the structure of the interrupt controller 86 of the exemplary IC. Interrupt requests from the logic module 96 (see FIG. 1a), external interrupt inputs (such as hookswitch/lock-ups), the serial I/O 94, the parallel I/O (see FIG. 13 and the accompanying discussion), keypad scanner 88, and the real-time clock 74 modules feed the two main interrupt source registers 178, 180. A master interrupt mask function is provided in the microcontroller in the form of a main mask register 0 182, and a main mask register 1 184.

By way of example only, set forth immediately below is a list of interrupt causes in the exemplary IC employed in a cordless telephone application.

    ______________________________________                                         INTERRUPT CAUSE  SET/CLEARED                                                   ______________________________________                                         D channel receive                                                                               SET: Receive buffer contains                                                   6 bytes of data                                                                CLEARED: When receive buffer                                                   is read                                                       D channel receive error                                                                         SET: Error detected in                                                         received D channel data                                                        CLEARED: D Channel Status                                                      Register is read                                              D channel transmit                                                                              SET: Transmit buffer empty                                                     CLEARED: When transmit buffer                                                  is loaded                                                     SI/O receive     SET: Receive buffer full                                                       CLEARED: Reading receive                                                       buffer                                                        SI/O transmit    SET: Transmit buffer empty                                                     CLEARED: When transmit buffer                                                  is loaded                                                     RTC timer        SET: Timer bit set (and not                                                    masked)in RTC Source Register                                                  CLEARED: Reading RTC Source                                                    Register                                                      RTC alarm        SET: Alarm bit set (and not                                                    masked)in RTC Source Register                                                  CLEARED: Reading RTC Source                                                    Register                                                      RTC update end   SET: Update end bit set (and                                                   not masked) in RTC Source                                                      Register                                                                       CLEARED: Reading RTC Source                                                    Register                                                      PI/O P1.0-P1.1   SET: Programmed edge of non-                                                   masked port 1 pin                                                              CLEARED: Reading PI/O                                                          Interrupt Source Register 0                                   PI/O P1.2-P1.3   SET: Programmed edge of non-                                                   masked port 1 pin                                                              CLEARED: Reading PI/O                                                          Interrupt Source Register 1                                   PI/O P1.4-P1.7   SET: Programmed edge of non-                                                   masked port 1 pin                                                              CLEARED: Reading PI/O                                                          Interrupt Source Register 2                                   Keypad status    SET: Change in Keypad Status                                                   Register                                                                       CLEARED: Reading Keypad                                                        Status Register                                               Keypad any key down                                                                             SET: Key closure when IC is                                                    in shut-down mode                                                              CLEARED: Reading Main                                                          Interrupt Source Register 1                                   External interrupt inputs 1,                                                                    SET: Any transition of the                                    2, and 3         external interrupt input pins                                                  (normally used for hookswitch,                                                 synthesizer lockup, and                                                        modulator lock-up                                                              CLEARED: Reading the                                                           indicated External Interrupt                                                   Status Register (one register                                                  for each input)                                               CHM              SET: Rising edge of CHM                                                        signal                                                                         CLEARED: Reading CHM/Sync                                                      Source Register                                               SYNC             SET: Rising edge of sync                                                       signal                                                                         CLEARED: Reading CHM/Sync                                                      Source Register                                               SYNC-D           SET: Rising edge of sync-D                                                     signal                                                                         CLEARED: Reading CHM/Sync                                                      Source Register                                               Sync error       SET: Rising edge of sync                                                       error signal                                                                   CLEARED: Reading CHM/Sync                                                      Source Register                                               ______________________________________                                    

FIG. 7 shows the structure of the status, mask, and source registers necessary to handle interrupt cause signals from the logic module 96.

The interrupt controller module 86 of the exemplary IC is comprised of seven user-accessible registers: a main interrupt source register 0 186; a main interrupt mask register 0 188; a main interrupt source register 1 190; a main interrupt mask register 1 192; a D-channel status register 194; a CHM/SYNC mask register 196; and a CHM/SYNC interrupt source register 198.

The interrupt controller 86 includes an INT0/OUT pin, and an INT1/OUT pin. The INT0/OUT signal is an output from the interrupt controller 86 to the microcontroller 40. It is routed off-chip via the INT0/OUT pins. It is used only in in-circuit emulation mode. When the IC is not in in-circuit emulation mode, this pin is used for the chip select zero (CSOUT0) output. The INT1/OUT pin carries a signal which is an output from the interrupt controller 86 to the microcontroller 40. It is routed off-chip via the INT1/OUT pin. It is used only in in-circuit emulation mode. When the IC is not in in-circuit emulation mode, this pin is used for the chip select one (CSOUT1) output.

User accessible registers in the interrupt controller module include the main interrupt source register 0 186; the main interrupt source register 1 190; the main interrupt mask register 0 188; the main interrupt mask register 1 192; the D channel status register; the CHM/Sync interrupt source register 198; and the CHM/Sync mask register 196.

SYSTEM CONTROL--WATCHDOG TIMER/RESET

The watchdog timer 46 detects if the microcontroller software becomes hung-up or lost, and generates a hardware reset to the IC as well as the rest of the system. The watchdog timer 46 is not operational in shut-down or in-circuit emulation modes.

SYSTEM CONTROL--PARALLEL PORT

The parallel I/O port of the exemplary IC consists of the microcontroller port 1 interrupt structure, a 11-bit general purpose output latch, 2 tri-level input pins, and three external interrupt inputs. The RxD and TxD pins in microcontroller port 3 can also operate as general purpose I/O ports. These ports are organized as discussed immediately below.

With respect to the microcontroller port P1.0-P1.7, maskable interrupts are programmably generated on one edge of each pin. In the exemplary IC, for interrupt reporting purposes, the pins are divided into three separate interrupt source registers, one for P1. 7-4, one for P1.3-2, and one for P1.1-0.

The general purpose outputs, of which there are 11, are programmed via the general purpose outputs registers 0 and 1. The outputs all default high.

The two tri-level input single pins can report three input states, high, low, or open. Typical applications are dial type selection and factory test mode selection. Additionally, as discussed in considerable detail above, TRI-LEVEL IN1 is used to select in-circuit emulation mode.

With respect to the external interrupt inputs, three input pins are provided that generate interrupt requests on both rising and falling edges. These pins can be used for hookswitch, channel synthesizer lock-up, and modem synthesizer lock-up inputs.

Functionally, all eight of the port 1 pins, when programmed as inputs, can generate maskable interrupts on edge transitions. The interrupt function is implemented in hardware separate from the microcontroller. FIG. 10 shows the basic structure of the interrupt function of the exemplary IC.

Referring to FIG. 10, the output latch of the exemplary IC provides 11 general purpose output pins for controlling external functions. This is a simple pair of registers (one 7-bit and one 4-bit) residing on the microcontroller data bus. When a bit is set in one of the registers (by software), the corresponding output pin is also set. When the bit is cleared, the pin is cleared. All pins that provide one of the general purpose outputs as their default state, default to a high level.

The multiplexing control for all pins except the keypad (OUT 6,7) and tri-level input (OUT 10) is located in the module where their other function originates, not in the parallel port module (designated by reference numeral 208 in FIG. 10). The keypad and tri-level multiplexing is controlled in general purpose output register 1.

When the parallel I/O port is disabled, via a module enable control register 0 located in the clock generator module 82, all pins that are operating as general purpose outputs are placed in a high impedance state.

Continuing to refer to FIG. 10, two pins are provided in the exemplary IC that can detect three distinct input states: high, low, and open, or no connect. The state of the input is reported in an external interrupt status register. These pins do not generate interrupt requests. The TRI-LEVEL IN1 pin is used primarily for selecting the operating mode of the IC after the RESET pin goes inactive. The TRI-LEVEL IN1 pin can be used as a general input in slight variations of the exemplary IC, but extreme care should be taken since a reset could cause the IC to enter the in-circuit emulation mode.

Referring still further to FIG. 10, three interrupt inputs are provided in the exemplary IC that generate interrupt requests on both rising and falling transitions. The status of each input pin is reported in a separate one-bit register. If a pin changes state since the last time its status register was read or reset, an interrupt request is latched and sent to the interrupt controller module. Reading the source register clears the latch and thus the interrupt request.

In general, in FIG. 10, it may be seen that the 11 outputs of the exemplary IC are independently controlled by their respective bits in the general purpose output control registers 0 and 1. Further, the input pins are pulled to mid-supply (Vcc/2) by pull-up and pull-down resistors when read. The pins each feed a separate pair of comparators. One is biased to produce a high at its output if the input is high, and one is biased to produce a high at its output if the input is low. If the input is open, both comparators output a low state. Still further, it may be noted that the pin logic should be designed to disable the pull-up and pull-down resistors when the state of the pin is not being evaluated. This is a power saving feature. The maximum resistance of the external input with respect to Vcc or Vss is 50 Ohms (when the input is high or low). The maximum capacitance is 50 pF.

Referring now to FIG. 11, there is shown a more detailed view of the external interrupt input structure of the exemplary IC in which the in-circuit emulation capability mode of the present invention may be included. It may be seen therein that this structure comprises three input pins 220, 222, 224, three status registers 226, 228, 230, and three transition detector latches 232, 234, 236.

The three external interrupt input status registers 226, 228, 230, which are one-bit registers, report the current status of the external interrupt input pins 220, 222, 224. The status bit changes as the pins change. Reading one of the registers clears the associated transition detector latch 232, 234, 236. The output of each latch 232, 234, 236 is fed to the interrupt controller module 86 where it is ANDed with an enable bit.

SYSTEM CONTROL--SERIAL PORT

The serial interface of the exemplary IC is a combination of four serial channels. In the exemplary IC, these channels provide communication with frequency synthesizers, an LCD controller, an EEPROM, and a PCM codec test equipment. A combined set of transmit, receive, and clock logic is used to support the synthesizer, LCD, EEPROM, and PCM interfaces (see FIG. 12 wherein the transmit, receive and clock logic are generally designated by reference numerals 240, 242 and 244, respectively). This combined set of hardware is referred to as the SI/O interface.

With respect to the constructed synthesizer interface of the exemplary IC, it may be noted that communication between the IC and a synthesizer chip, e.g., an MB1501 synthesizer chip, is unidirectional. Communication goes only from the IC to the synthesizer.

With respect to the LCD interface of the exemplary IC, a serial interface is provided for communicating between the on-chip microcontroller and an NEC μPD7225 LCD controller IC, or the like. This is also a one direction interface, with communication going only from the IC to the LCD controller.

The EEPROM interface of the exemplary IC is bidirectional, and is compatible with 8- and 16-bit devices that support the National, General Instruments, Exel interface. Additionally, support for devices that output data on the falling edge of the clock is required. Thus, for compatibility with a wide variety of devices, the port can be programmed to receive data on the rising or falling edge.

With respect to the PCM test port of the exemplary IC, two special modes can be invoked from software that will convert the serial port to a codec or ADPCM transcoder test port. In codec test mode, the Data In pin becomes the 64 kbps codec receive input, the Data Out pin becomes the 64 kbps codec transmit output, and the Clock pin becomes a gated 512 kHz PCM data clock output (bursts of eight cycles at the 8 kHz frame rate). In ADPCM test mode the Data In pin becomes the 64 kbps ADPCM transmit input (PCM data input), the Data Out pin becomes the 64 kbps ADPCM receive output (PCM data output), and the Clock pin becomes the 512 kHz PCM data clock output (eight bit bursts at the 8 kHz frame rate). The B/D channel port provides the 8 kHz frame sync clock. The 64 kHz data clock must be synchronized to the 8 kHz frame sync.

The PCM test port of the exemplary IC does not use the serial I/O port's transmit buffer, receive buffer, or clock generator. The audio path logic provides the clock and a serial transmit bit stream, and receives the receive data in serial form. In other words, the PCM test function uses the serial I/O port pins, but the logic to support clock generation, clock synchronization, serial to parallel, and parallel conversion is handled within the audio path logic.

SYSTEM CONTROL--KEYPAD SCANNER

The keypad scanner of the exemplary IC in which an embodiment of the in-circuit emulation capability mode of the present invention may be included provides the ability to support keypads of up to 36 keys. This keypad scanner operates in two modes: 1) activity detect, and 2) normal.

In the activity detect mode, it is not necessary to determine which key is depressed, only that a key has been depressed. This allows the IC to wake up from shut-down mode when the user presses a key. An output is generated to the clock generator module 82 when activity is detected while the IC is in shut-down mode.

In normal mode, the identity of the depressed key is determined and reported. Debouncing is the responsibility of the user software. An interrupt is generated when activity is detected, e.g., when a key is closed. Typically, the user responds to the interrupt by masking the keypad interrupt, setting a microcontroller timer (debounce time is typically 4 to 16 milliseconds), and returning from the interrupt. When the timer expires an interrupt is generated. This causes the user to read a keypad status register, which at this time contains the stable identity of the depressed key. This status includes a no keys down code (00000000), a multiple keys down code (0XXXXXX1), and codes for each of the keys (0RRRCCC0); R=row code, C=column code, and X=don't care.

FIG. 13 shows a block diagram of the keypad scanner. The module is comprised of the scanner unit 250 and the keypad status register 252.

The scanner 250 contains row and column input pins and comparators, and a block of logic 254 that detects the no keys down, multiple keys down, and any key down conditions.

The status logic formats the inputs from the scanner, and presents this status to the user. More specifically, keypad status logic comprises the following:

Inputs

6 row comparator outputs

6 column comparator outputs

No keys down output

Multiple keys down output

microcontroller Read strobe

microcontroller data bus

Register select strobe from address decoder module

Outputs

Register drives the internal data bus when accessed by the address decoder module.

An interrupt request is generated whenever the value of the register changes. This interrupt request is connected to interrupt controller.

Encoder

The six row and six column signals are encoded into two three-bit words (octal to binary encoding). This is combined with The no keys down and multiple keys down indications to form a seven-bit word. Bit 7 of the register is always 0.

SYSTEM CONTROL--REAL-TIME CLOCK

A real-time clock is provided on the exemplary IC. This clock 74 (see FIG. 1a) operates from the normal IC supply while the IC is powered on, and from a dedicated battery when the IC is powered down. A 32.768 kHz crystal is connected to the real-time clock. Additionally, a 1k byte block of RAM is provided. This "on-chip" RAM is independent from the real-time clock except that it is powered from the real-time clock's BATT IN pin.

FIG. 14 shows a block diagram of the real-time clock module 74 of the exemplary IC.

SYSTEM CONTROL--BATTERY LEVEL DETECTOR

The exemplary IC includes a mechanism providing a digital representation of the power supply (i.e., battery) voltage level over a range of 2.7 to 5.5 volts.

Functionally, the battery voltage monitor circuit compares the voltage on a Vcc pin to an internal threshold voltage. If Vcc is above the threshold voltage, the comparator output is high. If Vcc is below the threshold, the comparator output is low. In the exemplary IC, the internal threshold voltage is programmable via a 4-bit code from 2.7 Volts to 5.4 Volts, with an accuracy of ±5%.

FIG. 15 is a block diagram of the battery level detector module of the exemplary IC.

CT2

The CT2 portion of an exemplary IC which incorporates the in-circuit emulation capability mode of the present invention may include the following modules: FIFOs 90, a B/D Channel Port (see FIG. 1a), a transmit modem 100, an RSSI A/D Converter 92, and a logic module 96.

In the exemplary IC, two unidirectional FIFOs 260, 262 are provided between the ADPCM block 84, the B channel I/O 264, and the frame formatter 96, with one in the transmit direction and one in the receive direction 262 (see FIG. 16). These FIFOs provide an elastic store between the 72 kbps radio burst rate and the constant 32 kbps ADPCM, B channel port rate. The FIFOs appear to be serial when viewed from the frame formatter 96, and 4 bits wide when viewed by the ADPCM block 84 because the ADPCM operates on nibbles.

The FIFO module 90 in the exemplary IC builds 512 kHz, 32 kHz, and 8 kHz clocks from either a 1.152 MHz clock from the logic module 96, (specifically, a PLL1152) or a fixed 1.152 MHz clock from the clock generator module 82.

The B/D Channel I/O Port module 264 in the exemplary IC provides six I/O pins that are multiplexed to serve four separate functions: a B channel I/O port, including encryption; a D channel I/O port; a single transmit (Tx Modulator I/O); and six general purpose output ports.

The transmit modulator 100 of the exemplary IC accepts serial data from the CT2 logic module 96 and converts it to a quadrature pair of single-ended analog outputs. The outputs generated in the exemplary IC are intended to be externally mixed with an IF carrier and summed to obtain the desired frequency modulated signal.

A block diagram of the modulator 100 is shown in FIG. 17. The heart of the modulator 100 is a look-up ROM 270 addressed by a data dependent state machine address generator 272 and followed by a series of synchronizing latches 274. Two identical 6-bit+sign DAC's followed by buffers drive the analog outputs.

As discussed in much greater detail in various of the related applications, a test mode may be provided in the exemplary IC to simplify spectral measurements.

The receive signal strength indication (RSSI) module 92 provides a digital representation of the RF receive signal level.

Discussing now generally the logic module 96, a frame controller is provided which comprises a receive timing recovery, a frame timing generator, a SYNC channel handler, a B channel handler, a D channel handler, and a modem timing adjustment.

FIG. 18 is a block diagram of the frame controller, including the receive timing recovery, frame timing generator, SYNC channel handler, B channel handler, D channel handler.

With regard to the receive timing recovery function, bit synchronized timing from the receive data (Rx Data) is generated and fed to the various functions.

The SYN channel handler receives a burst signal and the PLLed clock from the receive clock generator (DPLL) and it gives received sync information to the frame timing generator and the CPU. It also receives transmit timing pulses from the frame timing generator, transmit data from the B channel handler and the D channel handler and it generates a transmit burst signal.

The frame timing generator receives received synchronization information from the syn channel handler when the system is receiving a signal, gives all the necessary receive and transmit timing pulses to the B channel handler, the D channel handler, the SYN channel handler of the transmit portions, MODEM timing adjustment, and any other blocks where those pulses are required.

The modem timing adjustment measures the delay of the modem and the RF section when they are transmitting and receiving a reference signal from the modem.

CORDLESS TELEPHONE APPLICATION

As previously discussed, the in-circuit emulation capability mode of the present invention is well-suited for use in a cordless telephone, when included in an IC to be used in a cordless telephone. Referring now to FIGS. 2 and 3, shown therein is a cordless telephone of a type into which IC's including the in-circuit emulation capability mode according to the teachings of the present invention, for example, the exemplary IC previously described, may be incorporated. Such a cordless telephone includes a handset or terminal unit 2 (shown in FIG. 2) and a base unit or base station 4 (shown in FIG. 3). Base unit 4 is connected by a telephone cord to an outlet or receptacle in a wall, a telephone pole, or another fixed structure, so that it may both receive and transmit telephone message signals through a telephone network line 6 and so that it also may be powered thereby. An antenna 8 on the handset 2, and a corresponding antenna 10 on the base station 4 are used to create a communication channel between the two units by the transmission and reception of radio waves. As is conventional, handset unit 2 includes a keypad 12 for making or dialing outgoing calls, and a mouthpiece and an earpiece, with which a microphone 14 and a loudspeaker 16 are, respectively, associated. A telephone number may be entered on the keypad 12, and corresponding information is transmitted over the communication channel to base unit 4, and thence to the telephone network line 6. Alternatively, when base unit 4 receives a message signal from the telephone network line 6 indicating that an incoming call is present, a signal from base unit 4 causes a ringing sound in handset unit 2 and a second ringing sound in base unit 4 to indicate the existence of the incoming call.

The standard maximum separation of such a handset unit 2 and base unit 4, which is called the service area, is about 300 meters, and is set by the Federal Communications Commission (FCC). Typically, there are ten duplex channels permitted for each system with the upper channel having a frequency in the 49 MHz band and the lower channel having a frequency in the 46 MHz band. Of course, such operating parameters are set by the FCC and do not form a part of the present invention.

The base station 4, like the handset 2, comprises a microphone 22, an ear piece 24, and a keypad 26. Likewise, both the handset 2 and the base station 4 include a ROM 28, 30, an EPROM 32, 34, an LCD and controller 36, 38, as well as a number of other elements which generally relate to the radio signals and power levels.

As may also be seen in FIGS. 2 and 3, an IC including the in-circuit emulator capability mode according to the teachings of the present invention is used in both the handset unit 2 and the base station 4. The IC is designated by reference numeral 18 in FIG. 2 and by reference numeral 20 in FIG. 3.

Based upon the foregoing, those skilled in the art should now fully understand and appreciate the improvements made by the teachings herein. Those skilled in the art should also fully understand and appreciate the value and merits of the in-circuit emulation capability mode described herein which may be incorporated in an IC and, in particular, in an IC for use in cordless telephones. On virtually every point made herein, however, further details may be found in the related cases listed in the cross-reference to related applications section above. Although those details are not necessary for those skilled in the art to practice the present invention or to comprehend its best mode of practice, those details may be useful to those skilled in the art and they may wish to refer to them.

Obviously, numerous modifications and variations are possible in light of the teachings herein. Accordingly, within the scope of the appended claims, the present invention may be practiced otherwise than as specifically described above. 

What is claimed is:
 1. An integrated circuit (IC) comprising:a microcontroller having input/output (I/O) ports, each I/O port having I/O lines mapped for use according to a desired function; interrupt controller circuitry electronically connected to said microcontroller internal to said IC at a specific I/O port having I/O lines mapped for an interrupt function; keypad scanner circuitry having external IC connections and being electrically connected to said interrupt controller internal to said IC; and means for setting said integrated circuit in at least one of a normal mode and an in-circuit emulation mode, wherein during the in-circuit emulation mode (i) the I/O ports of said microcontroller are held at high impedance and internal IC connections to the I/O ports of said microcontroller which are not routed off-chip for use during the normal operation mode are routed off-chip as multiplexed internal IC connections for use during the in-circuit emulation mode and (ii) said interrupt controller circuitry is adapted to respond to a first signal from said keypad scanner circuitry and then provide a second signal to an external in-circuit emulator via a multiplexed internal IC connection.
 2. The integrated circuit of claim 1, wherein said integrated circuit further comprises:a reset pin; and a tri-level input pin for triggering said means for setting said integrated circuit in at least one of said normal mode and said in-circuit emulation mode.
 3. The integrated circuit of claim 1, further comprising a clock input wherein said clock input is electrically connected to said micro controller and wherein said clock input is routed away from said micro controller when said integrated circuit is in said in-circuit emulation mode.
 4. The integrated circuit of claim 1, wherein said integrated circuit includes a watchdog timer which is disabled when said integrated circuit is in said in-circuit emulation mode.
 5. The integrated circuit of claim 1, wherein said integrated circuit includes at least one address bus control signal connection and at least one data bus control signal connection, at least one of said at least one address bus control or of said at least one data bus control signal becoming an input connection to said integrated circuit when said integrated circuit is in said in-circuit emulation mode.
 6. The integrated circuit of claim 1, further comprising at least one I/O port electrically connected to said micro controller when said integrated circuit is not in said in-circuit emulation mode, said at least one I/O port adapted to be electrically routed away from said micro controller to said external in-circuit emulator when said integrated circuit is in said in-circuit emulation mode.
 7. The integrated circuit of claim 1, further comprising a clock circuit electrically connected to at least one of a first timer input and a second timer input, said clock circuit having an output signal being electrically routed to said micro controller when said integrated circuit is in said in-circuit emulation mode and said clock circuit's said output signal being electrically routed away from said micro controller when said integrated circuit is not in said in-circuit emulation mode.
 8. An integrated circuit (IC) comprising:an input pin having at least two states, a first of said states being for setting said integrated circuit in a normal operation mode, a second of said states being for setting said integrated circuit in an in-circuit emulation mode; a microcontroller having input/output (I/O) ports adapted to be disabled and electrically connected to an external in-circuit emulator when said integrated circuit is in said in-circuit emulation mode, each I/O port having I/O lines mapped for use according to a desired function; interrupt controller circuitry electrically connected to said microcontroller internal to said IC at a specific I/O port having I/O lines mapped for an interrupt function, wherein during the in-circuit emulation mode (i) the I/O ports of said microcontroller are held at high impedance and internal IC connections to the I/O ports of said microcontroller which are not routed off-chip for use during the normal operation mode are routed off-chip as multiplexed internal IC connections for use during the in-circuit emulation mode and (ii) said interrupt controller circuitry is adapted to provide interrupt signals routed off-chip to the external in-circuit emulator via the multiplexed internal IC connections; and peripheral circuitry on said integrated circuit, said peripheral circuitry including at least an audio interface, said peripheral circuitry adapted to remain enabled when said integrated circuit is in said normal mode and said in-circuit emulation mode.
 9. The integrated circuit of claim 8, wherein said peripheral circuitry further comprises a timing frame formatter.
 10. The integrated circuit of claim 8, wherein said peripheral circuitry further comprises a transmit modem.
 11. The integrated circuit of claim 8, wherein said peripheral circuitry further comprises a keypad scanner.
 12. The integrated circuit of claim 8, wherein said peripheral circuitry further comprises a codec circuit and an ADCPM circuit.
 13. The integrated circuit of claim 8, wherein said input pin has three states, a third of said states being a test mode. 